import { requestVXBoss } from '../utils/request'

export default class VXBossApi {
  static getStationList = () => {
    return requestVXBoss({
      url: '/station/list',
      method: 'get'
    })
  }

  static getJobhunterList = (body: any) => {
    return requestVXBoss({
      url: '/jobhunter/list',
      method: 'get',
      params: {
        age: body.ageRange.join(','),
        activation: body.livenessSelected.join(','),
        gender: body.genderSelected[0],
        recentNotView: body.recentNotViewSelected[0],
        exchangeResumeWithColleague: body.exchangeResumeWithColleagueSelected[0],
        switchJobFrequency: body.switchJobFrequencySelected[0],
        school: body.schoolLevelSelected.join(','),
        experience: body.experienceRequireSelected.join(','),
        degree: body.educationalRequireSelected.join(','),
        jobId: body.stationId,
        page: body.pageNumber,
        firstDegree: body.firstSchoolLevel ? 999 : null,
        keywords: body.searchKeyword.text.join(','),
        salaries: body.salaryRequireSelected.join(','),
        intention: body.intentionSelected.join(',')
      }
    })
  }

  static triggerChar = (body: Jobhunter, stationId: string) => {
    return requestVXBoss({
      url: '/jobhunter/chat',
      method: 'post',
      data: {
        gid: body.jobhunterId,
        suid: body.suid,
        jid: stationId,
        expectId: body.expectId,
        lid: body.lid,
        from: '',
        securityId: body.securityId
      }
    })
  }

  static getTriggerChatUsed = () => {
    return requestVXBoss({
      url: '/jobhunter/chat/used',
      method: 'get'
    })
  }
}
